#include <bits/stdc++.h>
using namespace std;

const int maxn = 1e6 + 5;
int n, d, m;
int a[maxn];
vector<int> ord[maxn];  //存放每项任务下放的时间
struct node {
  int num;
  int time;
};

bool check(int x) {
  queue<node> q;
  int mach;  //机器数
  for (int i = 1; i <= n; ++i) {
    mach = x;
    while (!q.empty()) {  //处理残余的任务
      auto [num, time] = q.front();
      q.pop();
      if (time + d < i)  //来不及完成
        return false;
      --mach;
      if (!mach)  //机器数为0
        break;
    }
    if (!q.empty()) {  //可能是机器数不够退出来的，需要再检查
      auto [num, time] = q.front();
      if (time + d < i) return false;
    }

    for (auto v : ord[i]) {
      if (mach)  //还有机器
        --mach;
      else  //将任务留到下一次完成
        q.push({v, i});
    }
  }

  return true;
}

signed main() {
  cin >> n >> d >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> a[i];
    ord[a[i]].push_back(i);  // a[i]这个任务在第i次出现过
  }

  int lo = 1, hi = m, ans;
  while (lo <= hi) {  //普通二分
    int mid = lo + hi >> 1;
    if (check(mid)) {
      ans = mid;
      hi = mid - 1;
    } else
      lo = mid + 1;
  }

  cout << ans << endl;
  return 0;
}
